<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //1、数字类型转化为字符串类型，值仍为数字类型时的值，
    //但是类型变为字符串类型，可以使用+ ""来进行隐式转换
    var num = 12345;
    var notNum = NaN;
    var str1 = num + "";
    var str2 = notNum + "";
    console.log(str1,str2);

    var b1 = true;
    var b2 = false;
    var str3 = b1 + "";
    var str4 = b2 + "";
    console.log(str3,str4);

    //String可以进行类型的强制转换
    var u1 = undefined;
    var n1 = null;
    var str5 = String(u1);
    var str6 = String(n1);
    console.log(str5,str6);
</script>
</html>